package com.hzj.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import com.hzj.pojo.Money;
import com.hzj.service.MoneyService;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author hzj
 * @since 2021-07-29
 */
@RestController
@RequestMapping("/money")
public class MoneyController {
    @Autowired
    MoneyService service;

    @GetMapping("/add")
    public String add() {
        Money money = new Money();
        money.setMoney(100L);
        money.setUserId(1);
        int save = service.insertMoney(money);
        return "" + save;
    }

    @GetMapping("/edit")
    public int editMoney() {
        Money money = new Money();
        money.setId(1);
        money.setMoney(10L);
        money.setUserId(1);
        int edit = service.edit(money);
        return edit;
    }
}

